package com.guoby.utils;

import com.guoby.model.Result;

/**
 * Created by pactera on 2018/3/16.
 */
public class ResultUtil {

    /***
     * 操作成功返回信息设置
     *
     * @param data
     * @return
     */
    public static Result success(Object data){
        Result result = new Result();
        result.setCode(0);
        result.setMessage("成功");
        result.setData(data);
        return result;
    }

    public static Result error(Integer code, String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMessage(msg);
        return null;
    }


}
